package com.im.db;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBFactory {

	static Connection con;
	
	public static Connection getCon(){
		try{
			if(con==null){
				Class.forName("com.mysql.jdbc.Driver");
				String url = "jdbc:mysql://localhost:3306/dbcars";
				con = DriverManager.getConnection(url,"root","0147");
			}
		}catch(Exception e){
			e.printStackTrace();
		}
		
		return con;
		
	}
	
}
